package com.lyh.system.service.impl;

import java.util.List;
import com.lyh.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lyh.system.mapper.MemberInvitationMapper;
import com.lyh.system.domain.MemberInvitation;
import com.lyh.system.service.IMemberInvitationService;

/**
 * 用户推广信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-04-27
 */
@Service
public class MemberInvitationServiceImpl implements IMemberInvitationService 
{
    @Autowired
    private MemberInvitationMapper memberInvitationMapper;

    /**
     * 查询用户推广信息
     * 
     * @param id 用户推广信息主键
     * @return 用户推广信息
     */
    @Override
    public MemberInvitation selectMemberInvitationById(Long id)
    {
        return memberInvitationMapper.selectMemberInvitationById(id);
    }

    /**
     * 查询用户推广信息列表
     * 
     * @param memberInvitation 用户推广信息
     * @return 用户推广信息
     */
    @Override
    public List<MemberInvitation> selectMemberInvitationList(MemberInvitation memberInvitation)
    {
        return memberInvitationMapper.selectMemberInvitationList(memberInvitation);
    }

    /**
     * 新增用户推广信息
     * 
     * @param memberInvitation 用户推广信息
     * @return 结果
     */
    @Override
    public int insertMemberInvitation(MemberInvitation memberInvitation)
    {
        memberInvitation.setCreateTime(DateUtils.getNowDate());
        return memberInvitationMapper.insertMemberInvitation(memberInvitation);
    }

    /**
     * 修改用户推广信息
     * 
     * @param memberInvitation 用户推广信息
     * @return 结果
     */
    @Override
    public int updateMemberInvitation(MemberInvitation memberInvitation)
    {
        memberInvitation.setUpdateTime(DateUtils.getNowDate());
        return memberInvitationMapper.updateMemberInvitation(memberInvitation);
    }

    /**
     * 批量删除用户推广信息
     * 
     * @param ids 需要删除的用户推广信息主键
     * @return 结果
     */
    @Override
    public int deleteMemberInvitationByIds(Long[] ids)
    {
        return memberInvitationMapper.deleteMemberInvitationByIds(ids);
    }

    /**
     * 删除用户推广信息信息
     * 
     * @param id 用户推广信息主键
     * @return 结果
     */
    @Override
    public int deleteMemberInvitationById(Long id)
    {
        return memberInvitationMapper.deleteMemberInvitationById(id);
    }

    @Override
    public List<MemberInvitation> selectMemberInvitationByMemberId(Long id) {
        return memberInvitationMapper.selectMemberInvitationByMemberId(id);
    }
}
